/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface MaintenanceWorkTask extends BasicModel<MaintenanceWorkTask> {
  enterpriseCode?: string; // 所属企业编码
  enterpriseName?: string; // 所属企业名称
  equipmentId?: string; // 设备ID
  equipmentName?: string; // 设备名称
  name?: string; // 工单名称
  address?: string; // 地点
  abnormalPic?: string; // 异常图片URL
  abnormalId?: string; // 异常图片ID
  maintenanceName?: string; // 维保企业名称
  maintenanceCode?: string; // 维保企业编码
  remark?: string; // 隐患描述
  reportPersonName?: string; // 上报人名称
  reportPersonCode?: string; // 上报人编码
  reportTime?: string; // 上报时间
  regionId?: number; // 区域ID
  regionName?: string; // 区域名称
  executePerson?: string; // 执行人
  executePersonPhone?: string; // 执行人手机号码
  feedbackRemark?: string; // 反馈描述
  completeUrl?: string; // 完成图片URL
  completeId?: string; // 完成图片ID
  hiddenDangerId?: number; // 消防隐患ID
  addTime?: string; // 添加时间
  updateTime?: string; // 更新时间
}

export const maintenanceWorkTaskList = (params?: MaintenanceWorkTask | any) =>
  defHttp.get<MaintenanceWorkTask>({ url: adminPath + '/maintenance/management/maintenanceWorkTask/list', params });

export const maintenanceWorkTaskListData = (params?: MaintenanceWorkTask | any) =>
  defHttp.post<Page<MaintenanceWorkTask>>({ url: adminPath + '/maintenance/management/maintenanceWorkTask/listData', params });

export const maintenanceWorkTaskForm = (params?: MaintenanceWorkTask | any) =>
  defHttp.get<MaintenanceWorkTask>({ url: adminPath + '/maintenance/management/maintenanceWorkTask/form', params });

export const maintenanceWorkTaskSave = (params?: any, data?: MaintenanceWorkTask | any) =>
  defHttp.postJson<MaintenanceWorkTask>({ url: adminPath + '/maintenance/management/maintenanceWorkTask/save', params, data });

export const maintenanceWorkTaskDelete = (params?: MaintenanceWorkTask | any) =>
  defHttp.get<MaintenanceWorkTask>({ url: adminPath + '/maintenance/management/maintenanceWorkTask/delete', params });
